package it.yuzuojian.com.controller;

import it.yuzuojian.com.domain.Admin;
import it.yuzuojian.com.domain.CommonResult;
import it.yuzuojian.com.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;
    @PostMapping("/login/status")
    public CommonResult login(String username, String password){
        boolean flag = adminService.verifyPassword(username, password);
        if (flag) {
            return new CommonResult<Boolean>(1,"登入成功",flag);
        }
        return new CommonResult<Boolean>(0,"账户或密码失败",flag);
    }
}
